static short_handle mkshort_handle;
static short_handle mkshort_handle2; /* for track and route names */
static char *deficon = NULL;
+static char *cartoexplorer;
static int read_as_degrees;
static int route_ctr;
arglist_t pcx_args[] = {
{"deficon", &deficon, "Default icon name", "Waypoint",
ARGTYPE_STRING },
+ {"cartoexplorer", &cartoexplorer,
+ "Write tracks compatible with CartoExploreror", "",
+ ARGTYPE_STRING },
{0, 0, 0, 0, 0}
};
tp++;
}
- icon_token = mps_find_icon_number_from_desc(wpt->icon_descr, PCX);
- if (get_cache_icon(wpt)) {
- icon_token = mps_find_icon_number_from_desc(get_cache_icon(wpt), PCX);
+ if (deficon) {
+ icon_token = atoi(deficon);
+ } else {
+ icon_token = mps_find_icon_number_from_desc(wpt->icon_descr, PCX);
+ if (get_cache_icon(wpt)) {
+ icon_token = mps_find_icon_number_from_desc(get_cache_icon(wpt), PCX);
+ }
}
snprintf(buff, sizeof(buff)-1, "Trk%03d", route_ctr);
name = mkshort(mkshort_handle2, (trk->rte_name != NULL) ? trk->rte_name : buff);
- fprintf(file_out, "\n\nH TN %s\n", name);
+ /* Cartoexplorer (popular in France) chokes on trackname headers,
+ * so provide option to supppress these.
+ */
+ if (!cartoexplorer) {
+ fprintf(file_out, "\n\nH TN %s\n", name);
+ }
fprintf(file_out, "H LATITUDE LONGITUDE DATE TIME ALT ;track\n");
}